package com.eig.courseweb.controller;

import com.eig.common.vo.Result;
import com.eig.courseweb.service.CourseShouCangService;
import com.eig.courseweb.vo.ShouCangVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import javax.annotation.Resource;

/**
 * @author ：StudentLsj（李世界）
 * @date ：Created in 2022/12/30 上午 11:53
 * @description：
 * @modified By：
 * @version:
 */
@RestController
@RequestMapping("core/shoucangCourse")
@Api(tags = "我的收藏")
@EnableSwagger2
public class CourseShouCangController {

    @Resource
    private CourseShouCangService courseShouCangService;

    @PostMapping("/findFavoriteCourseById/{HuiYuanId}")
    @ApiOperation(value = "课程收藏查询")
    public Result findFavoriteCourseById(@PathVariable String HuiYuanId) {
        return courseShouCangService.findFavoriteCourseById(HuiYuanId);
    }
    @PostMapping("/findFavoriteCourse")
    @ApiOperation(value = "渲染页面是否已经收藏")
    public Result findFavoriteCourse(@RequestBody ShouCangVo s ) {
        return courseShouCangService.findFavoriteCourse(s);
    }

    @PostMapping("/deleteFavoriteCourse")
    @ApiOperation(value = "取消课程收藏")
    public Result deleteFavoriteCourse(@RequestBody ShouCangVo s) {
        return courseShouCangService.deleteFavoriteCourse(s);
    }
    @PostMapping("/addFavoritescourse")
    @ApiOperation(value = "课程收藏")
    public Result addFavoritescourse(@RequestBody ShouCangVo s) {
        return courseShouCangService.addFavoritescourse(s);
    }



}
